package com.yumeng.framework.auth.bean.authinfo;

import com.yumeng.common.auth.BaseAuthInfo;
import com.yumeng.common.data.enums.AuthMode;

import java.util.Set;

/**
 * 特殊用户
 * 如定时任务用户
 * @author wxd
 * @date 2025/2/26 20:34
 */
public class SpecialAuthInfo extends BaseAuthInfo {

    private static volatile SpecialAuthInfo authInfo = null;

    public static SpecialAuthInfo getSingleInstance(){
        if (authInfo == null){
            synchronized (SpecialAuthInfo.class){
                if (authInfo == null){
                    authInfo = new SpecialAuthInfo();
                }
            }
        }
        return authInfo;
    }

    @Override
    public String getIdentityId() {
        return "-2";
    }

    @Override
    public String getIdentityName() {
        return "特殊用户";
    }

    @Override
    public String getAuthKey() {
        return "specialUser";
    }

    @Override
    public String getCredentials() {
        return null;
    }

    @Override
    public String getSalt() {
        return null;
    }

    @Override
    public String getUserTypes() {
        return null;
    }

    @Override
    public AuthMode getAuthMode() {
        return AuthMode.UN_AUTH;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }

    @Override
    public boolean isAccountLocked() {
        return false;
    }

    @Override
    public boolean isAccountExpired() {
        return false;
    }

    @Override
    public boolean isCredentialsExpired() {
        return false;
    }

    @Override
    public Set<String> getAuthorities() {
        return Set.of();
    }

    @Override
    public void eraseCredentials() {
    }
}
